/*  1:   */ package nl.siegmann.epublib.bookprocessor;
/*  2:   */ 
/*  3:   */ import java.io.ByteArrayOutputStream;
/*  4:   */ import java.io.IOException;
/*  5:   */ import java.io.OutputStreamWriter;
/*  6:   */ import java.io.Reader;
/*  7:   */ import java.io.Writer;
/*  8:   */ import nl.siegmann.epublib.domain.Book;
/*  9:   */ import nl.siegmann.epublib.domain.Resource;
/* 10:   */ import nl.siegmann.epublib.epub.BookProcessor;
/* 11:   */ import org.apache.commons.io.IOUtils;
/* 12:   */ import org.slf4j.Logger;
/* 13:   */ import org.slf4j.LoggerFactory;
/* 14:   */ 
/* 15:   */ public class TextReplaceBookProcessor
/* 16:   */   extends HtmlBookProcessor
/* 17:   */   implements BookProcessor
/* 18:   */ {
/* 19:28 */   private static final Logger log = LoggerFactory.getLogger(TextReplaceBookProcessor.class);
/* 20:   */   
/* 21:   */   public byte[] processHtml(Resource resource, Book book, String outputEncoding)
/* 22:   */     throws IOException
/* 23:   */   {
/* 24:34 */     Reader reader = resource.getReader();
/* 25:35 */     ByteArrayOutputStream out = new ByteArrayOutputStream();
/* 26:36 */     Writer writer = new OutputStreamWriter(out, "UTF-8");
/* 27:37 */     for (String line : IOUtils.readLines(reader))
/* 28:   */     {
/* 29:38 */       writer.write(processLine(line));
/* 30:39 */       writer.flush();
/* 31:   */     }
/* 32:41 */     return out.toByteArray();
/* 33:   */   }
/* 34:   */   
/* 35:   */   private String processLine(String line)
/* 36:   */   {
/* 37:45 */     return line.replace("&apos;", "'");
/* 38:   */   }
/* 39:   */ }


/* Location:           C:\Users\David\workspace\CosaRaraPorqueSi\main\epublib-tools-3.1.jar
 * Qualified Name:     nl.siegmann.epublib.bookprocessor.TextReplaceBookProcessor
 * JD-Core Version:    0.7.0.1
 */